template <typename T>
struct binary_tree
{
    T data;
    binary_tree* left;
    binary_tree* right;
    binary_tree* father;
    
    // 构造函数
    binary_tree(const T& value): data(value), left(nullptr), right(nullptr), father(nullptr) {}
    binary_tree(const T& value,binary_tree* l,binary_tree* r):data(value),left(l),right(r){}
    // 析构函数
    ~binary_tree() {
        // 注意：这里只删除直接子节点，如果树很深可能需要递归删除
        delete left;
        delete right;
    }
    
    // 左边添加
    binary_tree* push_left(const T& value) {
        binary_tree* temp = new binary_tree(value);
        this->left = temp;
        temp->father = this; 
        return this;
    }
    
    // 右边添加
    binary_tree* push_right(const T& value) {  
        binary_tree* temp = new binary_tree(value);
        this->right = temp;
        temp->father = this;  
        return this;
    }
    
    // 可选：添加返回新节点指针的版本
    binary_tree* push_left_and_return(const T& value) {
        return push_left(value)->left;
    }
    
    binary_tree* push_right_and_return(const T& value) {
        return push_right(value)->right;
    }
};